******Upload data*********
use "Sust_supply_DATA.dta", clear

******Set locals to parse conjoint attributes by language
//English
local size1_EN "<b>Very large companies</b> – 25’000 employees or more"
local size2_EN "<b>Large and very large companies</b> – 2’500 employees or more"
local size3_EN "<b>Medium sized, large, and very large companies</b> – 250 employees or more"
local size4_EN "<b>All companies</b> with 25 employees or more"

local strict1_EN "<b>Slightly stricter</b> – annual confidential report no mandatory information" 
local strict2_EN "<b>Somewhat stricter</b> – annual confidential report with mandatory summary information"
local strict3_EN "<b>Much stricter</b> – annual public report with mandatory detailed information"

local action1_EN "<b>Not take any action</b> – only remind companies of their responsibility"
local action2_EN "<b>Take somewhat stronger action</b> – put company on public list, moderate financial penalty"
local action3_EN "<b>Take much stronger action</b> – put company on public list, severe financial penalty, stop buying supplies, press legal charges"


local proposal1_EN "Proposal A"
local proposal2_EN "Proposal B"
local size_lab_EN "This new law applies to:"
local strict_lab_EN "Reporting requirements are made:"
local action_lab_EN "If companies violate reporting requirements, government can:"

//German
local size1_DE "<b>Sehr große Unternehmen</b> (25.000 Angestellte oder mehr)"
local size2_DE "<b>Große und sehr große Unternehmen</b> (2.500 Angestellte oder mehr)"
local size3_DE "<b>Mittelgroße, große und sehr große Unternehmen</b> (250 Angestellte oder mehr)" 
local size4_DE "<b>Alle Unternehmen</b> (25 Angestellte oder mehr)"

local strict1_DE "<b>Geringfügig strenger</b> – vertraulicher Jahresbericht, ohne Pflichtangaben" 
local strict2_DE "<b>Etwas strenger</b> – vertraulicher Jahresbericht, mit wenig Pflichtangaben"
local strict3_DE "<b>Viel strenger</b> – öffentlicher Jahresbericht, mit umfassenden Pflichtangaben"
  
local action1_DE "<b>keine Maßnahmen treffen</b> – ausschließlich Unternehmen an ihre Verantwortung erinnern"
local action2_DE "<b>etwas strengere Maßnahmen treffen</b> – ein Unternehmen in ein öffentliches Verzeichnis eintragen, moderate Geldbußen auferlegen"
local action3_DE "<b>deutlich strengere Maßnahmen treffen</b> – ein Unternehmen in ein öffentliches Verzeichnis eintragen, hohe Geldbußen auferlegen, keine Betriebsmittel mehr beziehen, rechtlich gegen das Unternehmen vorgehen"

//French
local size1_FR = "<b>Aux très grandes entreprises</b> – de 25 000 employés ou plus"
local size2_FR = "<b>Aux grandes et très grandes entreprises</b> – de 2 500 employés ou plus"
local size3_FR = "<b>Aux entreprises de taille moyenne, grandes et très grandes</b> – de 250 employés ou plus"
local size4_FR = "<b>À toutes les entreprises</b> de 25 employés ou plus"

local strict1_FR = "<b>Un peu plus strictes</b> – rapport annuel confidentiel, sans informations obligatoires"
local strict2_FR = "<b>Plus strictes</b> – rapport annuel confidentiel comportant des informations obligatoires sous forme succincte"
local strict3_FR = "<b>Bien plus strictes</b> – rapport annuel public comportant des informations obligatoires sous forme détaillée"

local action1_FR = "<b>Ne prendre aucune mesure</b> – simplement rappeler leurs responsabilités aux entreprises"
local action2_FR = "<b>Prendre des mesures plus sévères</b> – inscrire l’entreprise sur une liste publique et lui imposer une sanction financière modérée"
local action3_FR = "<b>Prendre des mesures bien plus sévères</b> – inscrire l’entreprise sur une liste publique, lui imposer une sanction financière sévère, cesser d’acheter ses fournitures auprès d’elle, et engager des poursuites à son encontre"

//Belgian
local size1_BE = "<b>Zeer grote bedrijven</b> – minimaal 25.000 werknemers"
local size2_BE = "<b>Grote en zeer grote bedrijven</b> – minimaal 2.500 werknemers"
local size3_BE = "<b>Middelgrote, grote en zeer grote bedrijven</b> – minimaal 250 werknemers"
local size4_BE = "<b>Alle bedrijven</b> met minimaal 25 werknemers"

local strict1_BE = "<b>Enigszins strenger</b> – jaarlijks vertrouwelijk rapport, geen verplichte informatie"
local strict2_BE = "<b>Strenger</b> – jaarlijks vertrouwelijk rapport met verplichte beknopte informatie"
local strict3_BE = "<b>Veel strenger</b> – jaarlijks openbaar rapport met verplichte gedetailleerde informatie"

local action1_BE = "<b>Geen enkele actie ondernemen</b> – de overheid kan bedrijven alleen herinneren aan hun verantwoordelijkheden"
local action2_BE = "<b>Enigszins strenger optreden</b> – bedrijf op een openbare lijst plaatsen, middelmatige financiële sanctie opleggen"
local action3_BE = "<b>Veel strenger optreden</b> – bedrijf op een openbare lijst plaatsen, zware financiële sanctie opleggen, stoppen met het aankopen van benodigdheden, juridische aanklacht indienen"

//Spainish
local size1_ES = "<b>Empresas muy grandes</b> – 25 000 empleados o más"
local size2_ES = "<b>Empresas grandes y muy grandes</b> – 2500 empleados o más"
local size3_ES = "<b>Empresas medianas, grandes y muy grandes</b> – 250 empleados o más"
local size4_ES = "<b>Todas las empresas</b> con 25 empleados o más"

local strict1_ES = "<b>Ligeramente más rigurosos</b> – informe confidencial anual sin requisitos en cuanto a información obligatoria"
local strict2_ES = "<b>Un poco más rigurosos</b> – informe confidencial anual con el requisito de proporcionar información resumida obligatoria"
local strict3_ES = "<b>Mucho más rigurosos</b> – informe público anual con el requisito de proporcionar información detallada obligatoria"

local action1_ES = "<b>No podrá actuar</b> – solo podrá recordarles a las empresas cuál es su responsabilidad"
local action2_ES = "<b>Tendrá un poco más de capacidad para actuar</b> –  podrá añadir las empresas a una lista pública e imponerles una sanción económica moderada"
local action3_ES = "<b>Tendrá una capacidad de actuación considerable</b> –  podrá añadir las empresas a una lista pública, imponerles una sanción económica onerosa, suspender la compra de suministros y emprender acciones legales"

//Italian
local size1_IT = "<b>Aziende molto grandi</b> – 25.000 dipendenti o più"
local size2_IT = "<b>Aziende grandi e molto grandi</b> – 2.500 dipendenti o più"
local size3_IT = "<b>Aziende medie, grandi e molto grandi</b> – 250 dipendenti o più"
local size4_IT = "<b>Tutte le aziende</b> con 25 dipendenti o più"

local strict1_IT = "<b>Leggermente più rigidi</b> – report annuale confidenziale senza informazioni obbligatorie"
local strict2_IT = "<b>Abbastanza più rigidi</b> – report annuale confidenziale con informazioni riassuntive obbligatorie"
local strict3_IT = "<b>Molto più rigidi</b> – report annuale pubblico con informazioni dettagliate obbligatorie"

local action1_IT = "<b>Non prendere alcun provvedimento</b> – solo ricordare alle aziende le loro responsabilità"
local action2_IT = "<b>Prendere provvedimenti abbastanza più forti</b> – inserire l'azienda in un elenco pubblico, sanzione pecuniaria moderata"
local action3_IT = "<b>Prendere provvedimenti molto più forti</b> – inserire l'azienda in un elenco pubblico, sanzione pecuniaria pesante, interruzione dell'acquisto delle forniture, denuncia"

//Japanese
local size1_JA "<b>超大規模企業 </b>– 従業員2万5000人以上"
local size2_JA "<b>大企業、超大規模企業 </b>– 従業員2500人以上"
local size3_JA "<b>中規模企業、大企業、超大規模企業 </b>– 従業員250人以上"
local size4_JA "従業員25人以上の<b>全企業 </b>"

local strict1_JA "<b>やや厳格になる </b>– 非公開の年次報告書。情報に関する義務なし"
local strict2_JA "<b>ある程度厳格になる </b>– 非公開の年次報告書。情報に関する義務一部あり"
local strict3_JA "<b>はるかに厳格になる </b>– 公開の年次報告書。記載情報について詳細を規定" 

local action1_JA "<b>措置なし </b>– 企業にその責務を再認識させるのみ。"
local action2_JA "<b>ある程度強い措置 </b>– 公開リストに企業を掲載し、軽度の罰金を科す"
local action3_JA "<b>はるかに強い措置 </b>– 公開リストに企業を掲載し、重度の罰金を科し、調達を停止し、訴追する"

//Korean
local size1_KO "<b>초대형 기업</b> – 직원 25,000명 이상"
local size2_KO "<b>대기업 및 초대형 기업</b> – 직원 수 2,500명 이상"
local size3_KO "<b>중형 기업, 대기업, 초대형 기업</b> – 직원 수 250명 이상"
local size4_KO "<b>모든 기업</b> – 직원 25명 이상"


local strict1_KO "<b>약간 더 엄격</b> – 매년 비공개 보고서 제출, 필수 정보가 요구되지 않음"
local strict2_KO "<b>어느 정도 더 엄격</b> – 매년 비공개 보고서 제출, 필수 정보가 요구됨"
local strict3_KO "<b>훨씬 더 엄격</b> – 매년 공개 보고서 게시, 구체적인 필수 정보가 요구됨"


local action1_KO "<b>아무 조치도 취하지 않음</b> – 회사에 그들의 책임을 상기시킬 수만 있음"
local action2_KO "<b>약간 더 강한 조치 가능</b> – 공개 명단에 회사 등록, 중간 정도의 벌금 부과"
local action3_KO "<b>훨씬 더 강한 조치 가능</b> – 공개 명단에 회사 등록, 높은 수준의 벌금 부과, 정부 물품 구매 중단, 법적 고발"

//Dutch
local size1_NL = "<b>Zeer grote bedrijven</b> – 25.000 werknemers of meer"
local size2_NL = "<b>Grote en zeer grote bedrijven</b> – 2.500 werknemers of meer"
local size3_NL = "<b>Middelgrote, grote en zeer grote bedrijven</b> – 250 werknemers of meer"
local size4_NL = "<b>Alle bedrijven met</b> 25 werknemers of meer" 

local strict1_NL = "<b>Iets strenger</b> – vertrouwelijk jaarverslag, geen verplichte informatie"
local strict2_NL = "<b>Strenger</b> – vertrouwelijk jaarverslag, geen verplichte informatie"
local strict3_NL = "<b>Veel strenger</b> – openbaar jaarverslag met verplichte gedetailleerde informatie"

local action1_NL = "<b>Geen actie ondernemen</b> – alleen bedrijven op hun verantwoordelijkheid wijzen"
local action2_NL = "<b>Enigszins meer actie ondernemen</b> – bedrijf op een openbare lijst zetten, geringe financiële boete opleggen"
local action3_NL = "<b>Veel meer actie ondernemen</b> – bedrijf op een openbare lijst zetten, zware financiële boete, stoppen met het kopen van benodigdheden, juridische aanklacht indienen."


********Conjoint Outcomes, Attributes and Treatment*************
// Attributes
local att size strict action
foreach a of local att {
rename choice1_`a'1 `a'1
rename choice1_`a'2 `a'2
rename choice2_`a'1 `a'3
rename choice2_`a'2 `a'4
rename choice3_`a'1 `a'5
rename choice3_`a'2 `a'6
rename choice4_`a'1 `a'7
rename choice4_`a'2 `a'8
rename choice5_`a'1 `a'9
rename choice5_`a'2 `a'10
}

*forced choice reponse
gen sup_1 = 0 
replace sup_1 = 1 if A1_Q10_4==1
gen sup_2 = 0 
replace sup_2 = 1 if A1_Q10_4==2
gen sup_3 = 0 
replace sup_3 = 1 if A2_Q10_4==1
gen sup_4 = 0 
replace sup_4 = 1 if A2_Q10_4==2
gen sup_5 = 0 
replace sup_5 = 1 if A3_Q10_4==1
gen sup_6 = 0 
replace sup_6 = 1 if A3_Q10_4==2
gen sup_7 = 0 
replace sup_7 = 1 if A4_Q10_4==1
gen sup_8 = 0 
replace sup_8 = 1 if A4_Q10_4==2
gen sup_9 = 0 
replace sup_9 = 1 if A5_Q10_4==1
gen sup_10 = 0 
replace sup_10 = 1 if A5_Q10_4==2

*proposal support response
gen sup_alt_1 = 0 
replace sup_alt_1 = 1 if A1_Q10_2==1
gen sup_alt_2 = 0 
replace sup_alt_2 = 1 if A1_Q10_3==1
gen sup_alt_3 = 0 
replace sup_alt_3 = 1 if A2_Q10_2==1
gen sup_alt_4 = 0 
replace sup_alt_4 = 1 if A2_Q10_3==1
gen sup_alt_5 = 0 
replace sup_alt_5 = 1 if A3_Q10_2==1
gen sup_alt_6 = 0 
replace sup_alt_6 = 1 if A3_Q10_3==1
gen sup_alt_7 = 0 
replace sup_alt_7 = 1 if A4_Q10_2==1
gen sup_alt_8 = 0 
replace sup_alt_8 = 1 if A4_Q10_3==1
gen sup_alt_9 = 0 
replace sup_alt_9 = 1 if A5_Q10_2==1
gen sup_alt_10 = 0 
replace sup_alt_10 = 1 if A5_Q10_3==1


reshape long `att' sup_alt_ sup_, i(ResponseId) j(new)


local lang EN DE FR BE ES IT JA KO NL

//Size
gen size_num=.
foreach l of local lang {
foreach n of numlist 1/4{
replace size_num=`n' if size=="`size`n'_`l''"
}
}

la def size ///
	1 "Very large companies" ///
	2 "Large and very large companies" ///
	3 "Medium sized, large, and very large companies" ///
	4 "All companies with 25 employees or more"
la val size_num size

//Strict
gen strict_num=.
foreach l of local lang {
foreach n of numlist 1/3{
replace strict_num=`n' if strict=="`strict`n'_`l''"
}
}

la def strict ///
	1 "Slightly stricter" ///
	2 "Somewhat stricter" ///
	3 "Much stricter" 
la val strict_num strict

//Action
gen action_num=.
foreach l of local lang {
foreach n of numlist 1/3{
replace action_num=`n' if action=="`action`n'_`l''"
}
}
replace action_num=3 if action_num==. & language=="JA"

la def action ///
	1 "Not change this" ///
	2 "Allow for some government action" ///
	3 "Allow for strong government action" 
la val action_num action

//Clean up and label
foreach a of local att {
rename `a' drop_`a'
rename `a'_num `a'
}


rename sup_alt_ policy_support_alt
rename sup_ policy_support

la def policy_support 0 "No" 1 "Yes"
la val policy_support policy_support_alt policy_support

la var size "Size of Corporation"
la var strict "Regulatory Strictness"
la var action "Governmental Action"
la var policy_support "Policy Support"

//create treatment indicator
gen cj_treat=.
replace cj_treat=1 if ExpA=="1"
replace cj_treat=2 if ExpA=="2"
replace cj_treat=3 if ExpA=="3"

la def cj_treat 1 "Control" 2 "Con Market" 3 "Pro Market"
la val cj_treat cj_treat

********Sub-group Analyses*************
****Enviro Attitudes
gen enviro1=8-Q16_2_1
gen enviro2=Q16_3_1
gen enviro3=8-Q16_4_1
gen enviro4=8-Q16_5_1
gen enviro5=8-Q16_6_1
gen enviro6=8-Q16_7_1
gen enviro7=Q16_8_1

polychoric enviro1 enviro3 enviro4 enviro5 enviro6
mat polyfac=r(R)
factormat polyfac, n(24003) ipf fac(1)
predict drop_enviro_attitudes
egen enviro_attitudes=std(drop_enviro_attitudes)
la var enviro_attitudes "Environmental Attitudes"

drop drop*

****Social Value Orientation
*You Receive
recode Q18_2 ///
	(1=100) (2=98) (3=96) ///
	(4=94) (5=93) (6=91) ///
	(7=89) (8=87) (9=85), ///
	gen(SVO_you_1)
	
recode Q18_3 ///
	(1=100) (2=94) (3=88) ///
	(4=81) (5=75) (6=69) ///
	(7=63) (8=56) (9=50), ///
	gen(SVO_you_2)
	
recode Q18_4 ///
	(1=50) (2=54) (3=59) ///
	(4=63) (5=68) (6=72) ///
	(7=76) (8=81) (9=85), ///
	gen(SVO_you_3)
	
recode Q18_5 ///
	(1=50) (2=54) (3=59) ///
	(4=63) (5=68) (6=72) ///
	(7=76) (8=81) (9=85), ///
	gen(SVO_you_4)
	
recode Q18_6 ///
	(1=85) (2=87) (3=89) ///
	(4=91) (5=93) (6=94) ///
	(7=96) (8=98) (9=100), ///
	gen(SVO_you_5)
	
recode Q18_7 ///
	(1=85) (2=85) (3=85) ///
	(4=85) (5=85) (6=85) ///
	(7=85) (8=85) (9=85), ///
	gen(SVO_you_6)
	
egen SVO_you_mean = rowmean(SVO_you_*)
gen SVO_you=SVO_you_mean-50

*Other Receives
recode Q18_2 ///
	(1=50) (2=54) (3=59) ///
	(4=63) (5=68) (6=72) ///
	(7=76) (8=81) (9=85), ///
	gen(SVO_other_1)
	
recode Q18_3 ///
	(1=50) (2=56) (3=63) ///
	(4=69) (5=75) (6=81) ///
	(7=88) (8=94) (9=100), ///
	gen(SVO_other_2)
	
recode Q18_4 ///
	(1=100) (2=89) (3=79) ///
	(4=68) (5=58) (6=47) ///
	(7=36) (8=26) (9=15), ///
	gen(SVO_other_3)
	
recode Q18_5 ///
	(1=100) (2=98) (3=96) ///
	(4=94) (5=93) (6=91) ///
	(7=89) (8=87) (9=85), ///
	gen(SVO_other_4)
	
recode Q18_6 ///
	(1=15) (2=19) (3=24) ///
	(4=28) (5=33) (6=37) ///
	(7=41) (8=46) (9=50), ///
	gen(SVO_other_5)
	
recode Q18_7 ///
	(1=85) (2=76) (3=68) ///
	(4=59) (5=50) (6=41) ///
	(7=33) (8=24) (9=15), ///
	gen(SVO_other_6)
	
*SVO Indicator
foreach n of numlist 1/6 {
	replace SVO_other_`n'=SVO_other_`n'-50
}
egen SVO_other = rowmean(SVO_other_*)


gen SVO_rad=atan(SVO_other/SVO_you)
gen SVO_deg=(SVO_rad*180/_pi)

gen SVO=.
replace SVO=1 if SVO_deg<120&SVO_deg>=57.15
replace SVO=2 if SVO_deg<57.15&SVO_deg>=22.45
replace SVO=3 if SVO_deg<22.45&SVO_deg>=-12.04
replace SVO=4 if SVO_deg<-12.04&SVO_deg>=-70

la def SVO ///
	1 "Competitive" ///
	2 "Individualistic" ///
	3 "Pro-social" ///
	4 "Altruistic"
	
la val SVO SVO

preserve
keep ///
	ResponseId country language ///
	policy_support ///
	size strict action ///
	cj_treat ///
	enviro_attitudes poli_ori SVO
	
save "Sust_supply_DATA_LONG.dta", replace
restore

preserve
keep ///
	ResponseId country language ///
	policy_support_alt ///
	size strict action ///
	cj_treat ///
	enviro_attitudes poli_ori SVO
	
save "Sust_supply_DATA_SUPPLEMENTARY_LONG.dta", replace
restore

*********Create Wide data set for probes***************
//Upload data
use "Sust_supply_DATA.dta", clear

//Supply chains pre-experimental survey item
clonevar supp_policy = Q5_6
la var supp_policy "Support for New Supply Chain Regulations"

//Create experimental policy stringency assignment and cost probes
egen probe_hurtconsumer=rowtotal(Q11_10_1 Q12_10_1 Q13_10_1)
la var probe_hurtconsumer "This new law would hurt consumers by making imported products more expensive"

encode ExpB, gen(probe_exp)
la var probe_exp "Treatment: Policy Package Stringency"

//Save Wide
keep ResponseId probe_hurtconsumer probe_exp country supp_policy

save "Sust_supply_DATA_WIDE.dta", replace
